Ext.define('appfe.stockor.common.tools.CommonTools', {
    //extend: 'Ext.panel.Panel',
    extend: 'Ext.Container',
    xtype: 'commontools',
    layout: 'responsivecolumn',

    items: [{
        xtype: 'form',
        style: {
            backgroundColor: '#4caf50',
            padding: '10px 1px 1px 1px',
            boxShadow: '2px 2px 3px 0 rgba(0, 0, 0, 0.2)'
        },
        viewModel: {
            data: {
                postUrl: '',
                formdata: {// 表单信息
                    key: '',
                    value: ''
                }
            }
        },
        userCls: 'big-33 small-100',
        buttonAlign: 'center',
        waitMsgTarget: true, /*  true的意思是说表单提交时的等待信息在这个表单之内显示，而不是弹出框 */
        items: [{
            xtype: 'label',
            html: '<div style="color:#4caf50;font-size:26px;font-weight:bold;padding:20px 0px 10px 0px;text-align:center">保存认证Cookie</div>'
        }, {
            xtype: 'textfield',
            name: 'slimsymbol',
            anchor: '100%',
            margin: '10px 10px 10px 10px',
            fieldLabel: '股票简码<font color="#ff3333"><b>*</b></font>',
            emptyText: '00000000',
            value: '00000000',
            allowBlank: false
        }, {
            xtype: 'textfield',
            name: 'authCookie',
            anchor: '100%',
            margin: '10px 10px 10px 10px',
            fieldLabel: '认证Cookie<font color="#ff3333"><b>*</b></font>',
            emptyText: 'xq_a_token=32424;',
            value: '',
            allowBlank: false
        }],
        buttons: [{ // 提交按钮
            text: '确定',
            formBind: true,
            handler: function (btn) {
                this.up().up().submit({
                    url: BizHttpAction.saveXueQiuAuthCookie.url,
                    method: BizHttpAction.saveXueQiuAuthCookie.method,
                    waitMsg: '提交中...',
                    failure: function (form, action) {
                        var alertMsg;
                        if (action.result && action.result.message) {
                            alertMsg = action.result.message;
                        } else {
                            alertMsg = '操作失败, 请联系系统管理员'
                        }
                        Ext.Msg.alert('操作失败', alertMsg, function () {
                        });
                    }
                });
            }
        }]
    }],
    listeners: {
    }
});